#!/bin/bash
i=0
if [ "$1" = "mongo" ]
then
while [ $i -lt 1 ]
do
mongo $2 -utest -ptest --eval "printjson(db.$3.count())"| tail -1 >> /data/www/htdocs/firo/scripts/logs/mongo_insert_record.log
sleep $4
done
fi 
if [ "$1" = "mysql" ]
then
while [ $i -lt 1 ]
do
mysql $2 -e "select count(*) from $3"| tail -1 >> /data/www/htdocs/firo/scripts/logs/mysql_insert_record.log
sleep $4
done
fi 